using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace BusinessObjects
{
    /// <summary>
    /// Class that holds order details (line items) for an order.
    /// </summary>
    /// <remarks>
    /// Enterprise Design Pattern: Domain Model.
    /// 
    /// This is where your business logic resides. In this example there are none.
    /// Another place for business logic and business rules is in the Facade.  
    /// For an example see CustomerFacade in the Facade layer.
    /// 
    /// The Domain Model Design Pattern states that domain objects incorporate 
    /// both behavior and data. Behavior may include simple or complex business logic.
    /// </remarks>
    public class OrderDetail : BusinessObject
    {
        /// <summary>
        /// Default constructor for Order Detail.
        /// </summary>
        public OrderDetail()
        {
            Version = _versionDefault;
        }

        /// <summary>
        /// Overloaded  constructor for Order Detail.
        /// </summary>
        /// <param name="productName">Product name of Order Detail.</param>
        /// <param name="quantity">Quantity ordered.</param>
        /// <param name="unitPrice">Unit price of product at the time order is placed.</param>
        /// <param name="discount">Discount applied to unit price of product.</param>
        /// <param name="order">Order that Order Detail is part of.</param>
        public OrderDetail(int orderDetailId,int orderId, int categoryId, int productId, decimal unitPrice, int quantity, decimal discount, int status)
            : this()
        {
            OrderDetailId = orderDetailId;
            OrderId = orderId;
            CategoryId = categoryId;
            ProductId = productId;
            UnitPrice = unitPrice;
            Quantity = quantity;
            Discount = discount;
            Status = status;
        }

        /// <summary>
        /// Get or set the parent order id for this detail.
        /// </summary>
        public int OrderId { get; set; }

        /// <summary>
        /// Get or set the parent order id for this detail.
        /// </summary>
        public int OrderDetailId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int CategoryId { get; set; }

        /// <summary>
        /// Get or set the product id for this order detail.
        /// </summary>
        public int ProductId { get; set; }

        /// <summary>
        /// Get or set Product name of Order Detail (line item).
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// Get or set quantity of Products ordered.
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// Get or set unit price of Product in US$.
        /// </summary>
        public decimal UnitPrice { get; set; }

        /// <summary>
        /// Get or set discount applied to unit price.
        /// </summary>
        public decimal Discount { get; set; }

        
        /// </summary>
                /// </summary>
        public string Version { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int Status { get; set; }
    }
}
